Variable thresholding circuit for converting an analog signal to a binary signal

ABSTRACT

A variable thresholding circuit for converting an analog signal to a binary signal comprises a comparator to which signals to be converted are applied and a threshold circuit coupled with the comparator in order to provide the threshold level of the comparator, so that the signals applied to the comparator are converted into binary signals in accordance with the threshold level. The threshold level corresponding to the output of the threshold circuit is compensated in accordance with the variations of the levels of the signals applied to the comparator. The threshold level of the comparator is changed to a compensated level when the result calculated from the threshold level and the signals applied to the comparator is smaller than a predetermined value, whereas the threshold level of the comparator is not changed to the compensated one when the result calculated from the threshold level and the signals applied to the comparator is larger than that and the compensation is repeated until the calculated result becomes smaller than the predetermined value.

BACKGROUND OF THE INVENTION

This invention relates to a variable thresholding circuit for converting analog signals into digital signals, and more particularly, to a variable thresholding circuit in which a threshold level for converting analog signals such as image signals into binary signals is changed due to the level of the analog signals.

In the field of pattern recognition, image signals from an image pick-up device such as an industrial TV camera have been converted into binary signals in accordance with a constant threshold level. In this case, binary signals having stability for a long period of time have not been obtained since the gains and the DC levels of the image signals vary at a relatively slow speed due to the variations of temperature and brightness.

SUMMARY OF THE INVENTION

An object of this invention is to provide a variable thresholding circuit for converting an analog signal to a binary signal, the threshold level of which is changed due to variations of the gains and the DC levels of the image signals.

Another object of this invention is to provide a variable thresholding circuit for converting an analog signal to a binary signal operating with a high stability for a long period of time.

In order to achieve the above objects, the variable thresholding circuit for converting an analog signal to a binary signal of this invention comprises a comparator for comparing signals to be converted with a threshold level for quantization, from which binary signals are derived, and a threshold control circuit, coupled with the comparator, for controlling the threshold level thereof. The threshold level of the comparator is compensated in response to variations of the levels of the signals applied to the comparator. Further, the improved variable thresholding circuit of this invention is so designed that the threshold level of the comparator is compensated in response to variations of the levels of the signals in exception of the abnormal signals such as noise signals.

The above and other objects and advantages will be understood from the description of embodiments in connection with the following drawing.

BRIEF DESCRIPTION OF THE DRAWING

FIG. 1 is a diagram for explaining a principle of this invention.

FIG. 2 is a schematic block diagram of a portion of an embodiment of this invention.

FIG. 3 is a diagram of a time chart for explaining the embodiment shown in FIG. 2.

FIG. 4 is a schematic block diagram of an embodiment of this invention.

FIG. 5 is a diagram for explaining a principle of a modified embodiment of this invention.

FIG. 6 is a schematic block diagram of a portion of a modified embodiment of this invention, and

FIG. 7 is a schematic block diagram of a modified embodiment of this invention.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

Referring to FIG. 1, the principle of this invention will be explained. A signal S₁ designates an image signal from an image pick-up device such as an industrial TV camera, by which an object with a black and white pattern is picked-up. The lower and the higher levels of the signal S₁ represent the black and the white portions of the object, respectively. It is assumed that the signal S₁ corresponding to one frame of the image is obtained repeatedly with a period of T such as about 16.7 m sec. in a standard television system, since the object is static in a pattern recognition system, for instance. When the signal S₁ is converted into a binary signal with a threshold level L₁, the binary signal S₃ is obtained. If the level of the signal S₁, however, has been varied to produce a signal at a high level, such as a signal S₂, after a long period of time, an incorrect binary signal S₄ is obtained when the signal S₂ is converted into a binary signal using the threshold level L₁. But, when the signal S₂ is converted into a binary signal with a threshold level L₂ which is compensated in response to the variation of the image signal S₁, the correct binary signal S₃ is obtained. In order to compensate the threshold level, relative average levels are calculated, each of which corresponds to the upper and the lower portions of the image signal with respect to the original threshold level L₁ and they are utilized to compensate the threshold level for converting the image signal into a binary signal.

Now, the compensated threshold level is obtained from the following equations, in which the function of the image signal S₁ and the values of the original and the compensated threshold levels are represented by f(t), θ₀ and θ₁, respectively.

First of all, the following integrations are calculated in the first frame pick-up by the image pick-up device. ##EQU1## where Δf_(wo) and Δf_(B0) are the respective average levels of the upper and the lower portions which have levels higher and lower than the threshold level L₁ in the first frame; t_(wo) and t_(B0) are time regions defined by f(t) ≧ θ₀ and f(t) ≦ θ₀, respectively.

Accordingly, the value θ₁ of the compensated threshold level is shown by the following equation (3).

    θ.sub.1 = θ.sub.0 + α.sub.0 Δf.sub.wo - β.sub.0 Δf.sub.B0                              (3)

where, α₀ (≧0) and β₀ (≧0) are constants relating to the weights of Δf_(wo) and Δf_(B0) for compensating the threshold level. As a result, the value θ₁ of the compensated threshold level comes in the neighborhood of the value of the threshold level L₂. Accordingly, the value θ₁ of the compensated threshold level is utilized as the threshold level for the image signal of the next frame when |α₀ Δf_(wo) - β₀ Δf_(B0) | ≦ ε, where ε has various values in different cases, for instance, it is in the range of 1/100 to 1/2 with respect to the amplitude of the image signal in a case where the image signal from the industrial TV camera is converted into the binary signal since it is necessary that the value of ε be smaller than 1/2 of the maximum value of the image signal and larger than the signal to noise ratio (S/N) of the TV camera. But, the value θ₁ of the compensated threshold level cannot be utilized as the threshold level for the image signal of the next frame, when |α₀ Δf_(w0) - β₀ Δf_(B0) | > ε, because the difference between the compensated threshold level and the threshold level L₂ is large. In this case, the compensation for the threshold level is repeated so as to be indicated in the following equations in connection with the value θ₁ of the compensated threshold level in the first frame. ##EQU2## where Δf_(w1) and Δf_(B1) are the respective average levels of the upper and the lower portions which have levels higher and lower than the value θ₁ of the threshold level in the second frame; t_(w1) and t_(B1) are time regions defined by f(t) ≧ θ₁ and f(t) ≦ θ₁, respectively. Accordingly, the value θ₂ of the next compensated threshold level is shown as the equation (6).

    θ.sub.2 = θ.sub.1 + α.sub.1 Δf.sub.w1 - β.sub.1 Δf.sub.B1                              (6)

where α₁ (≧0) and β₁ (≧0) are constants relating to the weight of Δf_(w1) and Δf_(B1). Then, the value of |α₁ Δf_(w1) - β₁ Δf_(B1) | is compared with the value of ε. As a result, when |α₁ Δf_(w1) - β₁ Δf_(B1) | ≦ ε, the value θ₂ of the compensated threshold level is utilized as the threshold level, whereas when |α₁ Δf_(w1) - β₁ Δ_(B1) | > ε, the compensation for the threshold level is repeated as have been described. In general when |α_(n) Δf_(wn) - β_(n) Δf_(Bn) | ≦ ε, the value θ_(n+1) of the compensated threshold level is utilized as the threshold level, whereas, when the value of |α_(n) Δ f_(wn) - β_(n) Δf_(Bn) | is larger than the value of ε, the value θ_(n+1) of the (n+1)th threshold level is compensated as follows. ##EQU3##

Δf_(wn) and Δf_(Bn) are the respective average levels of the upper and the lower portions which have levels higher and lower than the value θ_(n) of the threshold level in the (n+1)th frame;

α_(n) and β_(n) are constants relating to the weight of Δf_(wn) and Δf_(Bn) ;

t_(wn) and t_(Bn) are time regions defined by f(t) ≧ θ_(n) and f(t) ≧ θ_(n), respectively, and n is 0, 1, 2, . . . . . In the above description, the compensated threshold level is calculated from the image signal f(t) over the one frame, but it can be calculated from a portion thereof.

Further, the compensation of the threshold level described above has been solved as a linear function such as the equation (7), but a non-linear function is utilized in severe analysis since the ratio between drifted value and signal levels of the image signals is different in the higher and the lower portions of the image signals. In this case, the following equation (10) can be substituted for the equation (7).

    θ.sub.n+1 = θ.sub.n + g.sub.1 (Δf.sub.wn, Δf.sub.Bn)                                          (10)

where g₁ is a function of Δf_(wn) and Δf_(Bn).

The function g₁ can be defined experimentally. However, it is not so different even if the drift of the image signal is linear, in comparison with non-linear drift. Accordingly, an embodiment of this invention will be explained relating to the compensation due to the linear function in order to be simple.

Referring now to FIGS. 2 and 3, a subtractor 200 has positive and negative terminals 201 and 202. A signal S₅ to be converted, such as an image signal, is applied to the positive terminal 201. A signal θ_(n) corresponding to a threshold level L_(n) is applied to the negative terminal 202. The subtractor 200 detects the difference between the signal S₅ and the signal θ_(n), the output of which is supplied to a half-wave rectifier 203 and a comparator 204. The half-wave rectifier 203 outputs a signal S₆ when the level of the signal S₅ is higher than the threshold level L_(n) and outputs a zero signal when the level of the signal S₅ is lower than the threshold level L_(n). The signal S₆ is supplied to an integrating circuit 205, and is integrated therein. The integrated value of the signal S₆ is stored in the integrating circuit 205 for a predetermined period of time, and then is reset by a reset pulse P₁ in each frame, as shown by a signal S₇. The comparator 204 compares the signal S₅ with the threshold level L₁ so that a binary signal S₈ is obtained as the output thereof. The output signal S₈ of the comparator 204 is supplied to an integrating circuit 206 and is integrated therein. The integrated value of the signal S₈ is stored in the integrating circuit 206, for a predetermined period of time, and then is reset by the reset pulse P₁ in each frame, as shown by a signal S₉. The integrated values a and b of the signals S₇ and S₉ correspond to the numerator and the denominator of the equation (8), respectively. The outputs of the integrating circuits 205 and 206 are supplied to a divider 207, in which a divisor (a/b) of the integrated values a and b is calculated, corresponding to the Δf_(wn) of the equation (8). The output S₁₀ of the divider 207 is supplied to a memory circuit 208, in which the output signal S₁₀ is stored for a predetermined period of time, and then is output from an output terminal 209. A timing control pulse P₂ is applied to a terminal 210, by which the divider 207 is actuated. The timing control pulse P₂ is produced from a pulse generator (not shown) synchronized with the synchronizing pulse of a vertical scanning in the TV camera, for example, which is generated in the fly-back period of the vertical scanning and is shown by a pulse signal S₁₁, for example. The reset pulses P₁ for the integrating circuits 205 and 206 are supplied from the terminal 210 through a delay circuit 211, the delay time of which is t₁ as shown in FIG. 3. The t₁ is so designed that the integrated values a and b are held in the integrating circuits 205 and 206 during a period long enough to be calculated in the divider 207. A pulse signal P₃ shown in FIG. 3 is supplied to the memory circuit 208 through a delay circuit 212, the delay time of which is t₂ as shown in FIG. 3, in order to write the calculated results in the memory circuit 208. The delay time t₂ is so designed that the calculated results are output after the calculation has finished in the divider 207. As a result, a signal S₁₂ for a threshold level is output from the terminal 209.

The embodiment for calculating the Δf_(wn) of the equation (8) has been described, but the Δf_(Bn) of the equation (9) can be calculated in the embodiment shown in FIG. 2, in the fact that the signals S₅ and θ_(n) are applied to the negative and positive terminals 202 and 201, respectively. Therefore, an embodiment for calculating the Δf_(wB) will be omitted.

An embodiment of this invention is shown in FIG. 4, in which an image signal f(t) from an industrial TV camera, for instance, is applied to a terminal 400. The signal f(t) is supplied to a comparator 401 and at same time to basic circuits 402 and 403, each of which corresponds to the circuit shown in FIG. 2. In more detail, the signal f(t) is supplied to the positive terminal 201 of the subtractor 200 in the basic circuit 402 and to the negative terminal 202 of the subtractor 200 in the basic circuit 403. A memory circuit 404 stores a value θ_(n) of a threshold level, where n is 0, 1, 2, . . . . , the output of which is supplied to the negative terminal 202 of the subtractor 200 in the basic circuit 402 and to the positive terminal 201 of the subtractor 200 in the basic circuit 403. As a result, Δf_(wn) and the Δf_(Bn) are output from the basic circuits 402 and 403, as have been described in FIG. 2. Memory circuits 405 and 406 store the values of α_(n) and β_(n) shown by the equation (7). The various values of α_(n) and β_(n) can be selectively output by control signals applied to terminals 407 and 408. The values of α_(n) and β_(n) depend upon the type of signal f(t) and the operating condition of the system, etc. and are selected experimentally. In this embodiment, the value of α_(n) is in the range of about 0.5 to 0.7, typically 0.55 and the value of β_(n) is in the range of about 0.3 to 0.5, typically 0.45. The outputs of the basic circuit 402 and the memory circuit 405, and the outputs of the basic circuit 403 and the memory circuit 406 are supplied to multipliers 409 and 410, respectively, so that the α_(n) Δ f_(wn) and the β_(n) Δf_(Bn) are obtained as the outputs of the multipliers 409 and 410, respectively. The outputs of the multipliers 409 and 410 are supplied to a subtractor 411, in which (α_(n) Δf_(wn) - β_(n) Δf_(Bn)) is calculated. An adder 412 is supplied the outputs of the subtractor 411 and the memory circuit 404, so that the value θ_(n+1) of the threshold level shown by the equation (7) is output. The output of the subtractor 411, on the other hand, is supplied to a discriminator 413 in order to discriminate whether |α_(n) Δf_(wn) - β_(n) Δf_(Bn) | is larger or smaller than ε. The value of ε depends upon the type of the signal f(t) and the operating condition of the system, etc. and is selected experimentally. In this embodiment, the value of ε is selected to about 1/64 while the image signal f(t) is normarized by the steps of 64. Accordingly, when |α_(n) Δf_(wn) - β_(n) Δf_(Bn) | is smaller than ε, an output pulse is produced from the discriminator 413 and supplied to an analog switching circuit 414 and a gate circuit 415, so that the value θ_(n+1) of the threshold level is supplied from the adder 412 through the analog switching circuit 414 to the comparator 401. As a result, the signal f(t) is converted to the binary signal with the value θ_(n+1) of the threshold level and the binary signal is obtained from the output terminal 416. However, when |α_(n) Δf_(wn) - β_(n) Δf_(Bn) | is larger than ε, an output signal θ_(n+1) is supplied to the memory circuit 404 through the analog switching circuit 414, the contents of which are rewritten from θ_(n) to θ_(n+1). As a result, the operation described above is repeated until the value of |α_(n) Δf_(wn) - β_(n) Δf_(Bn) | becomes smaller than ε.

Although the above embodiments are applied in the case where the waveform of the signal f(t) is simple such as shown in FIG. 1, modified embodiments will be explained hereinafter, which are applied in the case where the waveform of the signal f(t) is complicated, such as shown in FIG. 5.

Referring now to FIG. 5, the signal f(t) is shown as a signal S₂₀ which is converted into a binary signal with a threshold level θ₀. A waveform S₂₁ shows a signal having been varied from the signal S₂₀. The principle of the modified embodiment is to make a simple waveform in the region of the signal to be converted into the binary signal, whereby the suitable threshold level can always be obtained in the complicated waveform even if noise signals included therein. With respect to FIG. 5, a level A is used for neglecting the signal thereover and a level B is for neglecting the signal thereunder. In this case, as described above, the value θ₁ of the next threshold level is obtained as follows.

First of all, the following integrations are calculated in the first frame picked-up by the image pick-up device. ##EQU4## where Δf_(w0A) and Δf_(B0B) are the average levels of the regions R₁ and R₂, each of which is between the level A and the threshold level θ₀, and the level B and the threshold level θ₀, respectively; t_(w0A) and t_(B0B) are time regions defined by A ≧ f(t) ≧ θ₀ and θ₀ ≧ f(t) ≧ B, respectively. Accordingly, the value θ₁ of the threshold level is compensated by the following equation (13).

    θ.sub.1 = θ.sub.0 + γ.sub.0 {δ.sub.0 Δf.sub.w0A - (1-δ.sub.0)Δf.sub.B0B }    (13)

where δ₀ (≧0) and (1-δ₀) are constants relating to the weights of Δf_(w0A) and Δf_(B0B) ; γ₀ is a constant for adjusting the degree to be compensated, for instance, when the degree to be compensated is insufficient, the value thereof is larger than 1 and when it is over a suitable value, the value thereof is smaller than 1.

Next, the value of |γ₀ {δ₀ Δf_(w0A) - (1-δ₀)Δf_(B0B) }| is discriminated whether it is larger or smaller than ε. As a result, the value θ of the compensated threshold level is utilized as the threshold level for the image signal of the next frame when |γ₀ {δ₀ Δf_(w0A) - (1-δ₀)Δf_(B0B) }| ≧ ε, whereas the value θ of the compensated threshold level cannot be utilized as the threshold level for the image signal of the next frame when |γ₀ {δ₀ Δf_(w0A) - (1-δ₀)Δf_(B0B) }| > ε. Therefore, compensation for the threshold level is repeated as have been described. In general, when the value of |γ_(n-1) {δ_(n) Δf_(w0A) - (1-δ_(n))Δ f_(B0B) }| is larger than the value of ε, the value θ_(n+1) of the (n+1)th threshold level is compensated as follows. ##EQU5##

Δf_(wnA) and Δf_(BnB) are the average levels of regions between the level A and the threshold level θn, and between the level B and the threshold level θn, respectively; δn and (1 - δn) are constants relating to the weight of Δf_(wnA) and Δf_(BnB) ; γ_(n) is a constant for adjusting the degree to be compensated; t_(wnA) and t_(BnB) are time regions defined by A ≧ f(t) ≧ θn and θn ≧ f(n) ≧ B, respectively; and n is 0, 1, 2, . . . . . In this description, the compensated threshold level is calculated from the image signal f(t) over the one frame, but it can be calculated from the portion thereof. Further, the compensation of the threshold level has been solved as a linear function such as the equation (13), but a non-linear function can be used. In this case, the following equation (16) can be substituted for the equation (13)

    θ.sub.n+1 = g.sub.2 (θ.sub.n, Δf.sub.wnA, Δf.sub.BnB)                                         (16)

where g₂ is a function of θ_(n), Δf_(wnA) and Δf_(BnB). The function g₂ can be defined experimentally. However, the modified embodiment of this invention will be explained relating to the compensation in accordance with the linear function.

Referring to FIG. 6, in which the same elements shown in FIG. 2 are designated by the same reference numerals, comparator 600 has positive and negative terminals 602 and 603, and subtractor 601 has positive and negative terminals 604 and 605. The signal f(t) to be converted is applied to the positive terminals 602 and 604. The signal level A shown in FIG. 5 is applied to the negative terminal 603 and the threshold level θ_(n) is applied to the negative terminal 605. In the comparator 600, when the signal f(t) is larger than the signal level A, the signal "1" is output from the comparator 600, whereas when the signal f(t) is smaller than the signal level A, the signal "0" is output therefrom. The output of the comparator 600 is applied to an analog gate circuit 606 which is so controlled that the gate circuit 606 is closed when the signal "1" is applied thereto, whereas it is opened when the signal "0" is applied thereto. The subtractor 601 calculates the difference between the signal f(t) and the threshold level θ_(n), the output of which is supplied to the half-wave rectifier 203 and the comparator 204 through the analog gate circuit 606 in response to the output of the comparator 600. The signal treatment after the output of the analog gate circuit 606 has been supplied to the half-wave rectifier 203 and the comparator 204 is as same as that in the case shown in FIG. 2. The detailed description relating to this signal treatment will be omitted. As a result, the output terminal 209 shown in FIG. 6 outputs the signal of the Δf_(wnA) of the equation (14).

Although the circuit shown in FIG. 6 has been explained relating to the Δf_(wnA), the Δf_(BnB) of the equation (15) can be calculated thereby in the fact that the signal f(t) is applied to the negative terminals 603 and 605, and the signal level B shown in FIG. 5 and the threshold level θ_(n) are applied to the positive terminals 602 and 604, respectively. Therefore, a description relating to a circuit for calculating the Δf_(BnB) will be omitted.

A modified embodiment of this invention is shown in FIG. 7, in which an image signal f(t) from an industrial TV camera, for instance, is applied to a terminal 700. The signal f(t) is supplied to a comparator 701 and basic circuits 702 and 703. The each basic circuit 702 or 703 corresponds to the circuit shown in FIG. 6. In more detail, the signal f(t) is supplied to the positive terminals of the comparator 600 and the subtractor 601 in the basic circuit 702, and to the negative terminals of the comparator 600 and the subtractor 601 in the basic circuit 703. A memory circuit 704 stores a value θ_(n) of a threshold level, where n is 0, 1, 2, . . . , the output of which is supplied to the negative terminal 605 of the subtractor 601 in the basic circuit 702 and to the positive terminal 604 of the subtractor 601 in the basic circuit 703. A memory circuit 705 stores the values of the level A shown in FIG. 5. The various values of the level A can be selectively output by control signals applied to a terminal 706 so that the selected value of the level A is supplied to the negative terminal 603 of the comparator 600 in the basic circuit 702. A memory circuit 707 stores the values of the level B shown in FIG. 5. The value of the level B which is selected by control signals applied to a terminal 708 is supplied to the positive terminal 604 of the comparator 600 in the basic circuit 703. In this embodiment, the values of the levels A and B are selected to be about 63 and 15, respectively, while the image signal f(t) is normarized by the steps of 64. As a result, the Δf_(wnA) and Δf_(BnB) are output from the basic circuits 702 and 703, respectively. The outputs of the basic circuit 702 and a memory circuit 709 are supplied to a multiplier 711. The memory circuit 709 stores the various values of δn and the value selected by control signals applied to a terminal 710 is supplied to the multiplier 711. The outputs of the basic circuit 703 and a memory circuit 712 are supplied to a multiplier 714. The memory circuit 712 stores the values of (1 - δn) and the value selected by control signals applied to a terminal 713 is supplied to the multiplier 714. The value of δn depends upon the type of the signal f(t)and the operating condition of the system, etc. and is selected experimentally. In this embodiment, the value of δn is in the range of about 0.5 to 0.7, typically, 0.55. The outputs of the multipliers 711 and 714 are supplied to a subtractor 715 so that the {δ_(n) Δf_(wnA) - (1 - δn) Δf_(BnB) } is obtained as the output thereof. A memory circuit 716 stores the various values of γ_(n) and the value selected by control signals applied to a terminal 717 is supplied to a multiplier 718. The value of γ_(n) depends on the type of the signal f(t) and the operating condition of the system, etc. and is selected experimentally. In this embodiment, the value of γ_(n) is about 1.7. The outputs of the subtractor 715 and the memory circuit 716 are calculated in the multiplier 718, so that the output γ_(n) {δ_(n) Δf_(wnA) - (1 - δn) Δf_(BnB) } is obtained from the multiplier 718. An adder 719 is supplied the outputs of the multiplier 718 and the memory circuit 704 so that the value θ_(n+) 1 of the threshold level shown by the equation (13) is obtained. The output of the multiplier 718, on the other hand, is supplied to a discriminator 720 in order to discriminate whether |γ_(n) {δ_(n) Δf_(wnA) - (1 - δ_(n)) Δf_(BnB) }| is larger or smaller than ε which has been described above. Accordingly, an output pulse is produced from the discriminator 720 and supplied to an analog switching circuit 721 and a gate circuit 722 when |γ_(n) {δ_(n) Δf_(wnA) - (1 - δn) Δf_(BnB) }| is smaller than ε. As a result, the value θ_(n+1) of the threshold level is supplied from the adder 719 through the analog switching circuit 721 to the comparator, so that the signal f(t) is converted to the binary signal with the value θ_(n+1) of the threshold level and the binary signal is obtained from an output terminal 723. However, when |γ_(n) {δ_(n) Δ_(fwA) - (1 - δ_(n)) Δf_(BnB) }| is larger than ε, the output signal θ_(n+1) is supplied to the memory circuit 704 through the analog switching circuit 721, the contents of which are rewritten from θ_(n) to θ_(n+1). Accordingly, the above operation is repeated until the value of |γ_(n) {δ_(n) Δf_(wnA) - (1 - δ_(n)) Δf_(BnB) {| becomes smaller than ε.

In the above embodiments, the average levels of the upper and the lower portions which have levels higher and lower than the threshold level θ_(n) are calculated by using the functions (f(t) - θ_(n)) and (θ_(n) - f(t) as shown in the equations (8), (9), (14) and (15), but functions G₁ (f(t) - θ_(n)) and G₂ (θ_(n) - f(t) ) can be substituted for them, where G₁ and G₂ are functions of (f(t) - θ_(n)) and (θ_(n) - f(t) ). Further, functions H₁ (θ_(n) f(t)) and H₂ (θ_(n) f(t) ) can be substituted for G₁ (f(t) - θ_(n)) and G₂ (θ_(n) - f(t), respectively, where H₁ and H₂ are functions of θ_(n) and f(t). For instance, G₁ (f(t) - θ_(n)) is (f(t) - θ_(n))². In this case, the basic circuits as shown in FIGS. 2 and 6 are so designed that the equations relating to the functions G₁ (f) (t) - θ_(n)) and G₂ (θ_(n) - f(t) ), or H₁ (θ_(n) f(t) ) and H₂ (θ_(n) f(t) ) can be calculated. Further, the embodiments shown in FIGS. 4 and 7 are so constructed that the operations thereof are repeated, but the repeated operations may not be necessary if the values of αn, βn, γn and δn are suitable.

While only a few forms of the present invention have been shown and described, many modifications will be apparent to those skilled in the art within the spirit and scope of the invention as set forth in the appended claims. 

We claim:
 1. A variable thresholding circuit comprising:first means, to which an analog signal is applied; second means coupled with said first means, for converting said analog signal into binary signals with a variable threshold level; and third means coupled with said first and second means, for controlling said threshold level of said second means, said third means comprising fourth means for storing a predetermined threshold level; fifth means coupled with said first and fourth means, for calculating a value related to a required threshold level from average levels of the upper and lower portions of said analog signal which have levels higher and lower than said predetermined threshold level, respectively; sixth means coupled with said fifth means, by which the output of said fifth means is compared with a predetermined value; and seventh means coupled with said second, fourth, fifth and sixth means, for calculating said threshold level of said second means from the outputs of said fourth and fifth means, the output of said seventh means supplied to said second means in response to the output of said sixth means in such a manner that the threshold level of said second means is controlled.
 2. A variable thresholding circuit according to claim 1, wherein said fifth means includes eighth means coupled with said first and fourth means, for calculating said average level of the upper portion of said analog signal which has a level higher than said predetermined threshold level, with a predetermined weight, and ninth means, coupled with said first and fourth means, for calculating said average level of the lower portion of said analog signal which has a level lower than said predetermined threshold level with a predetermined weight.
 3. A variable thresholding circuit according to claim 2, wherein said seventh means is further coupled with said fourth means in such a manner that the contents of said fourth means are rewritten by the output of said seventh means when the output of said fifth means is larger than said predetermined value.
 4. A variable thresholding circuit comprising:first means, to which an analog signal is applied; second means coupled with said first means, for converting said analog signal into binary signals with a variable threshold level; and third means coupled with said first and second means, for controlling said threshold level of said second means, said third means comprising fourth means for storing a predetermined threshold level; fifth means coupled with said first and fourth means for calculating a value related to a required threshold level from average levels of the divided regions of said analog signal, said divided regions of said analog signal placed between a first predetermined level and said predetermined threshold level and between a second predetermined level and said predetermined threshold level, said respective regions being the upper and lower portions of said analog signal, respectively, with respect to said predetermined threshold level; sixth means coupled with said fifth means, by which the output of said fifth means is compared with a predetermined value; and seventh means coupled with said second, fourth, fifth and sixth means, for calculating said threshold level of said second means from the outputs of said fourth and fifth means, the output of said seventh means supplied to said second means in response to the output of said sixth means in such a manner that the threshold level of said second means is controlled.
 5. A variable thresholding circuit according to claim 4, wherein said fifth means includes eighth means coupled with said first and fourth means for calculating said average level of said upper region, with a predetermined weight, and ninth means coupled with said first and fourth means, for calculating said average level of the lower region, with a predetermined weight.
 6. A variable thresholding circuit according to claim 5, wherein further includes tenth means coupled with said fifth means, for adjusting the output of said fifth means, with a predetermined weight, the output of said tenth means applied to said sixth and seventh means.
 7. A variable thresholding circuit according to claim 6, wherein said seventh means is further coupled with said fourth means in such a manner that the contents of said fourth means are rewritten by the output of said seventh means when the output of said fifth means is larger than said predetermined value.
 8. A variable thresholding circuit comprising:first means, to which an analog signal is applied; second means coupled with said first means, for converting said analog signal into a binary signal with a variable threshold level; and third means coupled with said first and second means, for changing said threshold level of said second means, said third means including fourth means for storing a first threshold level; fifth means, coupled with said first and fourth means, for calculating the difference between values corresponding to average levels of the upper and lower portions of said analog signal which have levels higher and lower than said first threshold level, respectively; sixth means coupled with said fifth means, for comparing the calculation result of said fifth means with a predetermined value; and seventh means coupled with said second, fourth, fifth and sixth means, for obtaining a second threshold level by adding the calculation result of said fifth means to said first threshold level of said fourth means, said second threshold level being supplied to said second means as said threshold level in response to the comparison result of said sixth means indicating that the calculation result of said fifth means is smaller than said predetermined value.
 9. A variable thresholding circuit according to claim 8, which further includes eighth means coupled with said fourth, sixth and seventh means for supplying said second threshold level to said fourth means so that the contents of said fourth means are rewritten by said second threshold level, in response to the comparison result of said sixth means indicating that the calculation result of said fifth means is larger than said predetermined value.
 10. A variable thresholding circuit according to claim 8, wherein said fifth means includesninth means, coupled with said first and fourth means, for calculating said average level of the upper portion of said analog signal, with a predetermined weight, tenth means coupled with said first and fourth means, for calculating said average level of the lower portion of said analog signal, with a predetermined weight, and eleventh means, coupled with said ninth and tenth means, for calculating the difference between calculation results of said ninth and tenth means.
 11. A variable thresholding circuit according to claim 8, wherein said fifth means includesninth means, coupled with said first and fourth means, for calculating a value corresponding to said average level of the upper portion of said analog signal which has a level lower than a first predetermined level, tenth means, coupled with said first and fourth means, for calculating a value corresponding to said average level of the lower portion of said analog signal, which has a level higher than a second predetermined level, and eleventh means, coupled with said ninth and tenth means, for caclulating a value corresponding to the difference between the calculation results of said ninth and tenth means.
 12. A variable thresholding circuit according to claim 11, which further includestwelfth means, coupled with said fourth, sixth and seventh means, for supplying said second threshold level to said fourth means, so that the contents of said fourth means are rewritten by said second threshold level, in response to the comparison result of said sixth means indicating that the calculation result of said fifth means is larger than said predetermined value. 